import service from "@/utils/service";

// 获取维修记录列表
export const getMaintainRecordListApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairRepairRecord/page",
    method: "post",
    data
  });
};

// 新增编辑维修记录
export const addEditMaintainRecordApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairRepairRecord/add-or-update",
    method: "put",
    data
  });
};

// 获取维修记录详细
export const getMaintainRecordDetailApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairRepairRecord/getById",
    method: "get",
    params: data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 上传维修记录
export const uploadMaintainRecordApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairRepairRecord/upload",
    method: "get",
    params: data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 导出维修记录
export const exportMaintainRecordApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairRepairRecord/export/record/summary",
    method: "post",
    data,
    responseType: "blob"
  });
};

// 获取某个汽修站企业信息
export const getOneRepairStoreInfoApi = () => {
  return service({
    url: "/xiechetong/xctRepairCompany/getInfo",
    method: "get",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 获取所有汽修店企业信息
export const getAllRepairStoreInfoApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompany/page",
    method: "post",
    data
  });
};

// 编辑汽修站企业信息
export const editEnterpriseInfoApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompany/update",
    method: "post",
    data
  });
};

// 获取汽修站企业人员列表
export const getEnterprisePersonPageApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyPersonnel/page",
    method: "post",
    data
  });
};

// 新增汽修站企业人员
export const addEnterisePersonApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyPersonnel/add",
    method: "put",
    data
  });
};

// 编辑汽修站企业人员
export const editEnterisePersonApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyPersonnel/update",
    method: "post",
    data
  });
};

// 删除汽修站企业人员
export const deleteEnterisePersonApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyPersonnel/del",
    method: "delete",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 获取汽修站企业设备列表
export const getEnterpriseDevicePageApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyDevice/page",
    method: "post",
    data
  });
};
// 新增汽修站企业设备
export const addEnteriseDeviceApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyDevice/add",
    method: "put",
    data
  });
};
// 编辑汽修站企业设备
export const editEnteriseDeviceApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyDevice/update",
    method: "post",
    data
  });
};
// 删除汽修站企业设备
export const deleteEnteriseDeviceApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyDevice/del",
    method: "delete",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 获取合格证信息列表
export const getCertificatePageApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyCertificate/page",
    method: "post",
    data
  });
};

// 新增合格证信息
export const addCertificateApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyCertificate/add",
    method: "put",
    data
  });
};
// 编辑合格证信息
export const editCertificateApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyCertificate/update",
    method: "post",
    data
  });
};
// 删除合格证信息
export const deleteCertificateApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyCertificate/del",
    method: "delete",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 获取维修合同列表
export const getRepairContractPageApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyContract/page",
    method: "post",
    data
  });
};
// 新增维修合同
export const addRepairContractApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyContract/add",
    method: "put",
    data
  });
};
// 编辑维修合同
export const editRepairContractApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyContract/update",
    method: "post",
    data
  });
};
//删除维修合同
export const deleteRepairContractApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyContract/del",
    method: "delete",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};
